<!--# layout("/common/layout.html",{"jsBase":"/js/content/resColumn/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="colId" id="colId">

    <div class="layui-row">
        <div class="layui-form-item">

            <div class="layui-inline">
            <label class="layui-form-label">所属模块</label>
				<div class="layui-input-inline">
                                <layui:simpleDataSelect name="module" value="${has(resColumn)?resColumn.module:''}" data="${moduleList}"
                                            attrId="dictId" attrName="dictValue" laySearch="true" />
				</div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">省份</label>
                <div class="layui-input-inline">
                    <layui:simpleDataSelect name="provId" value="${has(resColumn)?resColumn.provId:''}" data="${provinceList}"
                                            attrId="provId" attrName="provName" laySearch="true" />
                </div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">栏目名称</label>
				<div class="layui-input-inline">
                                <input type="text" name="colName" id="colName" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
            <label class="layui-form-label">是否显示</label>
				<div class="layui-input-inline">
                                <input type="radio" name="colStatus" value="1" title="是" checked>
                                <input type="radio" name="colStatus" value="0" title="否">

				</div>
            </div>

            <!--<div class="layui-inline">-->
            <!--<label class="layui-form-label">是否置顶</label>-->
				<!--<div class="layui-input-inline">-->
                                <!--<input type="radio" name="isTop" value="1" title="是">-->
                                <!--<input type="radio" name="isTop" value="0" title="否" checked>-->

				<!--</div>-->
            <!--</div>-->

            <div class="layui-inline">
            <label class="layui-form-label">显示排序</label>
            <div class="layui-input-inline">
                <input type="text" name="colSort" id="colSort" autocomplete="off" maxlength="50" class="layui-input" lay-verify="required|number">
            </div>
        </div>

        </div>
    </div>
    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.define([ 'form', 'laydate', 'table','resColumnApi'], function(exports) {
    var form = layui.form;
    var resColumnApi = layui.resColumnApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(resColumnJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                form.on('submit(form)', function(){
                    resColumnApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(resColumnJson))){  -->
    var formJson = ${resColumnJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
